package com.mall.shopping.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.shopping.constants.ShoppingRetCode;
import lombok.Data;

import java.math.BigDecimal;

/**
 *  ciggar
 * create-date: 2019/7/24-16:29
 */
@Data
public class AllProductRequest extends AbstractRequest {

    private Integer page;
    private Integer size;
    private String sort;
    private Long cid;
    private BigDecimal priceGt;
    private BigDecimal priceLte;

    @Override
    public void requestCheck() {
        if(page <= 0){
            setPage(1);
        }
//        else if((priceGt < 0&&priceGt!=null||!"".equals(priceGt)) ||(priceLte < 0&&priceLte!=null||!"".equals(priceLte))){
//            throw new ValidateException(ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getCode(),ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
//        }
    }
}
